package com.zpark.transaction.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zpark.transaction.service.entity.PayChannel;
import com.zpark.transaction.service.entity.PlatformChannel;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @PackageName: com.zpark.transaction.service.mapper
 * @ClassName: IPlatformChannel
 * @Description:
 * @author: RZS
 * @date: 2024/5/21  11:12
 */
public interface IPlatformChannelMapper extends BaseMapper<PlatformChannel> {

    /**
     * 根据平台服务类型获取原始支付渠道(多表查询)
     * pay_channel、platform_channel、platform_pay_channel
     * @param platformChannelCode 平台服务类型编码
     * @return
     */
    @Select("select pc.* from " +
            "pay_channel pc, platform_channel pfc, platform_pay_channel ppc " +
            "where pc.channel_code = ppc.pay_channel and " +
            "pfc.channel_code = ppc.platform_channel and " +
            "pfc.channel_code = #{platformChannelCode}")
    List<PayChannel> selectPayChannelByPlatformChannel(String platformChannelCode);
}
